import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import 'routes/router.dart';
// import './provider/counter.dart';
import './provider/cart.dart';
import './provider/checkout.dart';

void main() => runApp(MyApp());


class MyApp extends StatefulWidget {
  MyApp({Key key}) : super(key: key);

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    // return MaterialApp(
    //   // home: Tabs()
    //   initialRoute: '/',
    //   onGenerateRoute: onGenerateRoute,
    //   theme: ThemeData(
    //     primaryColor: Colors.white
    //   ),
    //   debugShowCheckedModeBanner: false
    // );
    return MultiProvider(
      // 注册状态管理类
      providers: [
        // ChangeNotifierProvider(create: (_) => Counter()),
        ChangeNotifierProvider(create: (_) => Cart()),
        ChangeNotifierProvider(create: (_) => CheckOut()),
      ],
      child: MaterialApp(
        // home: Tabs()
        initialRoute: '/',
        onGenerateRoute: onGenerateRoute,
        theme: ThemeData(
          primaryColor: Colors.white
        ),
        debugShowCheckedModeBanner: false
      )
    );
  }
}